<template>
  <!-- 头部 -->
  <header class="header">
        <img src="../assets/logo.svg" alt="Logo" class="logo" />
        <nav class="navbar">
          <router-link to="/home" class="nav-link">首页</router-link>
          <router-link to="/grades" class="nav-link">成绩查询</router-link>
          <router-link to="/learning" class="nav-link">学习情况</router-link>
          <router-link to="/chat" class="nav-link">讯飞助理</router-link>
          <router-link to="/profile" class="nav-link">个人中心</router-link>
        </nav>
      </header>

  <!-- 主内容区域（整个 flex 容器包含菜单和右侧内容） -->
  <div style="display: flex">
    <!-- 左侧菜单 -->
    <div style="width: 200px; border-right: 1px solid #ddd; height: calc(100vh - 60px);">
      <el-menu router>
        <el-menu-item index="/management/Home">系统首页</el-menu-item>
        <el-menu-item index="/management/test">数据统计</el-menu-item>
        <el-menu-item index="/management/User">个人信息</el-menu-item>
        <el-menu-item index="/management/Exam">试卷生成</el-menu-item>
        <el-menu-item index="/management/Listener">语音识别</el-menu-item>
      </el-menu>
    </div>

    <!-- 右侧内容（子路由在此渲染） -->
    <div style="flex: 1; width: 0; background-color: #e1e4eb; padding: 10px;">
      <router-view></router-view>
    </div>

    <!-- 右侧主体开始部分 -->
     <!-- <div style="flex: 1;width: 0; background-color: #f5f7ff; padding: 10px">
        <RouterView @updateUser="updateUser"/>
     </div> -->
  </div>
</template>

<script>
import { RouterView } from 'vue-router';
import router from '@/router/index';

export default {
  name: 'management'
}
</script>
<style scoped>
.home-container {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
 .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #2c3e50;
    color: white;
  }
  .logo {
    width: 50px;
    height: auto;
  }
  .navbar {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .nav-link {
    margin: 0 10px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: color 0.3s ease;
  }
</style>